Convert voluptuous schema to msgspec #752
Convert voluptuous schema to msgspec #752abhishekmadan30 wants to merge 1 commit intotaskcluster:mainfrom
Conversation
ahal
left a comment
There was a problem hiding this comment.
Thanks, this is shaping up nicely!
I don't think I have any other major concerns, it's mostly all nits and a minor changes. So I think you can go ahead and start converting Gecko without fear of a major new request (from me at least :p)
...utter.project_name}}/taskcluster/{{cookiecutter.project_slug}}_taskgraph/transforms/hello.py
Outdated
Show resolved
Hide resolved
ahal
left a comment
There was a problem hiding this comment.
Nice, thanks for the updates! I don't see any fundamental problems or anything, though I'll reserve the right to request future changes as we test this out in Gecko ;)
I'll avoid approving this for now because I want to hold off landing until we have a working patch for Gecko, but I think you can go ahead and get started on that! Hopefully claude or some clever macros can help with the conversion, because there's going to be a lot of schemas :)
87e0de9 to
750511c
Compare
ahal
left a comment
There was a problem hiding this comment.
I didn't get a chance to review the whole thing, but I'll leave the comments I had so far for now and resume tomorrow. Figured you might want to get a head start
ahal
left a comment
There was a problem hiding this comment.
A few more comments, still not all the way through though.
| # List of package tasks this docker image depends on. | ||
| packages: Optional[List[str]] = None | ||
| # Information for indexing this build so its artifacts can be discovered. | ||
| index: Optional[Any] = None |
There was a problem hiding this comment.
You should import the schema from gecko_taskgraph.transforms.task and reference the index key there when we come across these "cross references".
|
Thanks, looks like you have some merge conflicts too. Please rebase and push your latest iteration and hopefully I can do one final review (of just the interdiff this time) |
a1e336a to
b936ea5
Compare
7623612 to
7c1b2ab
Compare
|
Is there any chance we can do this in a backwards-compatible way, e.g. by leaving existing util/schema.py APIs alone and adding the msgspec schemas as an alternative, so we can convert things piecemeal and avoid massive changes and likely regressions/back and forth? Or is that impossible for some reason? |
Yep, I am currently working on it, I think we will go with just a different name for each of the schemas. eg volutpous is still called |
96adc30 to
4f129da
Compare
4fcf590 to
75ca904
Compare
75ca904 to
6fa1be5
Compare
|
|
||
|
|
||
| def optionally_keyed_by(*arguments): | ||
| def optionally_keyed_by(*arguments, use_msgspec=False): |
There was a problem hiding this comment.
Oh, I see what you meant now by having separate functions for this.. For some reason I was thinking there'd be an object passed in here we could test, but that obviously isn't the case. I like this approach though.
| omit_defaults=True, | ||
| rename="kebab", | ||
| forbid_unknown_fields=True, | ||
| ): |
There was a problem hiding this comment.
Do you like Struct as a name? Do you have any other ideas? I'm not sure if I like it, but I can't really think of anything better.
| ) | ||
|
|
||
| # Fetches schema using msgspec | ||
| class FetchesStruct(Struct): |
There was a problem hiding this comment.
Would you mind splitting all the actual schema conversion work into a separate commit from supporting msgspec in validate_schema? This way it will be easy to prove that the generation works before and after the change.
28fedd3 to
6fa1be5
Compare
|
Hello there! I recently became a co-maintainer of msgspec and am looking through open issues referencing the project name. Let me know if I can help 🙂 |
|
Hi @ofek, thanks for the offer! I think we're good other than we're waiting for a new msgspec release to pick up the Python 3.14 support. As a library ourselves, we don't want to risk breaking our users if they happen to be using 3.14. We appreciate you stepping in to take over maintenance! |
No description provided.